package com.example.teacherservice.dto;

import com.example.teacherservice.entity.Student;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

@Data
@AllArgsConstructor
public class StudentWithClassesDTO {
    private Long id;
    private Long userId;
    private String stuName;
    private Long stuStudyTime;
    private Long stuScore;
    private UserInfo user;
    private List<ClassInfo> classes;

    public StudentWithClassesDTO(Student student, List<ClassInfo> classes) {
        this.id = student.getId();
        this.userId = student.getUserId();
        this.stuName = student.getStuName();
        this.stuStudyTime = student.getStuStudyTime();
        this.stuScore = student.getStuScore();
        this.user = new UserInfo(student.getUser());
        this.classes = classes;
    }
}